import styles from './QuestionCard.module.scss'
import { FC } from 'react'

type propsType = {
    _id: string
    title: string
    isPublished: boolean
    isStar: boolean
    answerCount: number
    createdAt: string
}

// FC<propsType> 泛型参数propsType用来指定props的类型
const QuestionCard: FC<propsType> = (props: propsType) => {
    const { _id, title, isPublished, isStar, answerCount, createdAt } = props
    return (
        <div className={styles.container}>
            <div className={styles.header}>
                <div className='left'>
                    <div className='title'>{title}</div>
                </div>
                <div className={styles.right}>
                    <div className='isPublish'>{isPublished}</div>
                    <div className='answerCount'>答卷：{answerCount}</div>
                    <div className='createdAt'>{createdAt}</div>
                </div>
            </div>
            <div className={styles.content}>
                <div className={styles.left}>
                    <div className='edit'>编辑问卷</div>
                    <div className='calculate'>数据统计</div>
                </div>
                <div className={styles.right}>
                    <div className='isStar'>标星</div>
                    <div className='copy'>复制</div>
                    <div className='delete'>删除</div>
                </div>
            </div>
        </div>
    )
}

export default QuestionCard
